import axiosServer from '../utils/request'

/**
 * 后端操作员登录
 * @param {*} username 
 * @param {*} password 
 * @returns 
 */
export const RequestLogin = (username,password)=>{
    return axiosServer({
        method:'post',
        data:{
            username,
            password
        },
        url:'/api/login'
    })
}

/**
 * 注册-带头像上传
 */
export const RequestRegister = (formData)=>{
    return axiosServer({
        method:'post',
        data:formData,
        headers: {'Content-Type':'multipart/form-data'},
        url:'/api/register'
    })
}


/**
 * 验证码
 */
 export const RequestVerifyCode = ()=>{
    return axiosServer({
        method:'get',
        url:'/api/verifyCode',
    })
}
/**
 * 效验验证码
 */
 export const RequestCheckCode = (verifyCode)=>{
    return axiosServer({
        method:'get',
        url:'/api/checkCode',
        params:{
            verifyCode
        }
    })
}

/**
 * 动态菜单
 */
export const RequestMenuList = (roleId)=>{
    return axiosServer({
        method:'get',
        url:'api/system/menus',
        params:{
            roleId
        }
    })
}

/**
 * 资源权限
 */
export const RequestResources = (roleId)=>{
    return axiosServer({
        method:'get',
        url:'api/system/resource',
        params:{
            roleId
        }
    })
}